import request from '../utils/request'
// 登录接口
export const getUserListApi = (params) => request({ url: '/system/user/findUserList', method: 'get', params })
// 导出用户列表
export const exportUserListApi = () => request({
  url: '/system/user/excel',
  method: 'post',
  responseType: 'blob'
})
// 添加用户
export const AddUserApi = (data) => request({ url: '/system/user/add', method: 'post', data })
// 获取用户信息
export const getUserApi = (id) => request({ url: `/system/user/edit/${id}`, method: 'get', id })
// 编辑用户
export const EditUserApi = (id, data) => request({ url: `/system/user/update/${id}`, method: 'PUT', data })
// 删除用户
export const deleteUserApi = (id) => request({ url: `/system/user/delete/${id}`, method: 'delete' })
// 用户启用
export const updateStatusUserApi = (id, status) => request({ url: `/system/user/updateStatus/${id}/${status}`, method: 'PUT' })
// 用户已有角色
export const getUserRolesApi = (id) => request({ url: `/system/user/${id}/roles` })
// 给用户分配角色
export const setUserRolesApi = (id, data) => request({ url: `/system/user/${id}/assignRoles`, method: 'post', data })
